import request from '@/utils/request'

// 查询预约申请列表
export function getAppointmentList(query) {
  return request({
    url: '/system/appointment/miniList',
    method: 'get',
    params: query
  })
}

// 查询预约申请详细
export function getAppointment(applyId) {
  return request({
    url: '/system/appointment/' + applyId,
    method: 'get'
  })
}

// 提交预约申请
export function submitAppointment(data) {
  return request({
    url: '/system/appointment/miniSubmit',
    method: 'post',
    data: data
  })
}

// 修改预约申请
export function updateAppointment(data) {
  return request({
    url: '/system/appointment',
    method: 'put',
    data: data
  })
}

// 删除预约申请
export function delAppointment(applyId) {
  return request({
    url: '/system/appointment/' + applyId,
    method: 'delete'
  })
}

// 根据商户ID查询预约申请列表
export function getAppointmentByMerchantId(merchantId) {
  return request({
    url: '/system/appointment/listByMerchant/' + merchantId,
    method: 'get'
  })
}

// 根据预约编号查询预约申请
export function getAppointmentByApplyNo(applyNo) {
  return request({
    url: '/system/appointment/applyNo/' + applyNo,
    method: 'get'
  })
}

// 扫描二维码查询预约信息
export function scanQrCode(applyNo) {
  return request({
    url: '/system/appointment/scanQrCode/' + applyNo,
    method: 'get'
  })
}

// 验证二维码
export function verifyQrCode(data) {
  return request({
    url: '/system/appointment/verifyQrCode',
    method: 'post',
    data: data
  })
}

// 查验预约（确认入场）
export function checkAppointment(data) {
  return request({
    url: '/system/appointment/check',
    method: 'post',
    data: data
  })
}

// 提交抽检结果
export function submitInspection(data) {
  return request({
    url: '/system/appointment/submitInspection',
    method: 'post',
    data: data
  })
}

// 转后台审核
export function transferToBackend(data) {
  return request({
    url: '/system/appointment/transferToBackend',
    method: 'post',
    data: data
  })
}